package com.fwj.authorization.staff.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fwj.authorization.staff.entity.SysRoleButton;
import com.fwj.authorization.staff.mapper.SysRoleButtonMapper;
import com.fwj.authorization.staff.service.SysRoleButtonService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * SysRoleButtonServiceImpl
 *
 * @author 樊温军
 * @date 2025/3/22 下午4:51
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SysRoleButtonServiceImpl extends ServiceImpl<SysRoleButtonMapper, SysRoleButton> implements SysRoleButtonService {
    @Override
    public IPage<SysRoleButton> getPage(Page<SysRoleButton> page, SysRoleButton sysRoleButton) {
        return baseMapper.getPage(page, sysRoleButton);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveRoleButton(List<SysRoleButton> sysRoleButtons) {
        return this.saveOrUpdateBatch(sysRoleButtons);
    }
}
